<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: red;
            position: relative;
        }
    </style>
</head>
<body>
    <div class="box" id="box"></div>
</body>
<script>
    var box = document.getElementById("box");
    box.onmousedown = function(e){
        var x = e.offsetX;
        var y = e.offsetY;
        console.log(x,y);
        document.onmousemove = function(event){
            var clientX = event.clientX;
            var clientY = event.clientY;
            box.style.top =  (clientY - y) + "px";
            box.style.left = (clientX - x) + "px";
        }
    }
    box.onmouseup = function(){
        document.onmousemove = null;
    }
    console.log(parseInt("qwe")) ;
</script>
</html>